#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

const int N = 210;

struct E
{
    int id, a, b, c;

    bool operator< (const E &t) const
    {
        if (c != t.c)
            return c > t.c;
        return id > t.id;
    }
};

priority_queue<E> q;

int n, x, y;

int main()
{
    cin >> n >> x >> y;
    for (int i = 0 ; i < n ; i ++)
    {
        int a, b, c;
        cin >> a >> b;
        c = pow((x - a), 2) + pow((y - b), 2);
        q.push({(i + 1), a, b, c});
    }

    for (int i = 0 ; i < 3 ; i ++)
    {
        int res = q.top().id;
        q.pop();
        cout << res << endl;
    }

    return 0;
}
